package com.security.spring.auth.impl;

import com.security.spring.auth.AuthService;
import com.security.spring.web.GrantType;
import com.security.spring.web.rq.GetTokenMessageDTO;
import com.security.spring.web.rs.TokenMessageDTO;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 */
@Service
public class WechatAuthServiceImpl implements AuthService {
    @Override
    public TokenMessageDTO doAuth(GetTokenMessageDTO getTokenMessageDTO) {
        TokenMessageDTO tokenMessageDTO = new TokenMessageDTO();
        if (GrantType.WECHAT_AUTHORIZATION_CODE.getType().equalsIgnoreCase(getTokenMessageDTO.getGrantType())) {
            tokenMessageDTO.setAccessToken("Wechat:gTTrOc6gsou0_bu5NTX2mI_NkkS9AAe9GChdvueiRG0");
            tokenMessageDTO.setExpireIn(7969L);
            tokenMessageDTO.setTokenType("Bearer");
            return tokenMessageDTO;
        }
        return null;
    }

    @Override
    public void doRegister() {

    }


}
